<template>
	<view class="container">
		<navBar></navBar>
		<!-- <search></search> -->
		<!-- <slideshow class="component"></slideshow> -->
		<grid :itemIndex1="itemIndex1"></grid>
		<waterfall></waterfall>

	</view>

</template>

<script>
	import waterfall from '/components/waterfall/waterfall.vue'
	import grid from '/components/grid/grid.vue'
	export default {
		data() {
			return {
				itemIndex1: 0
			}
		},
		methods: {
			sendTowaterfall(index) {
				this.itemIndex = index;
				uni.$emit('aEven', this.itemIndex)
			}
		},
		components: {
			waterfall,
			grid
		},
		created() {
			// 监听
			uni.$on('aEven', data => {
				console.log('grid组件传来的数据：', data)
				this.itemIndex1 = data
			})
		}
	}
</script>

<style scoped lang="scss">
	.container {
		background-color: #ffffff;
		/* 淡蓝色背景 */
		padding: 0px;
		/* 容器内边距 */

	}

	.component {
		margin-bottom: 15px;
		/* 每个组件之间的间距 */
	}

	/* 可根据需要调整每个子组件的样式 */
	.search {}

	.slideshow {}

	.grid {}

	.waterfall {}
</style>